<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<HEAD>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	
	<script language="javascript" src="../script/common.js"></script>

	<script>
		var qt = {}
		var inited = false;
		var org = null;
		function load(){
			createTable();
		}	
		/**查询部分**/
		//生成查询语句
		function createQuery(){
			var q = new Query("select o.id,o.ruleName,o.version,o.ruleDesc,o.state,o.startDate,o.endDate from PointRule as o where 1=1");
			return q;
		}
		//设置表格数据列
		function createColumn(){
			var columns = [						
				{type:"checkbox"},													
				{title:"规则名称",width:"20%"},
				{title:"版本识别号",width:"15%"},											
				{title:"规则描述",width:"15%"},										
	//			{title:"客户级别",width:"15%"},									
	//			{title:"计算公式",width:"15%"},
				{title:"状态",width:"20%",render:stateFunc1},
				{title:"起始时间",width:"15%",render:function(v){return v.format();}},
				{title:"结束时间",width:"15%",render:function(v){return v.format();}}
			]
			return columns;
		}
		//生成表格，创建QueryTable对象
		function createTable(){
			qt = new QueryTable("datalist",createQuery,createColumn());
			var j= getPara("id");	
			$("pointActivity_id").value =j;
			showData();					//显示查询结果方法
		}		
		function stateFunc1(v){
			return Common.getText("pointrule_state",v);	
		}
		//显示、刷新表格
		function showData(){	
			qt.showTable();				//qt为全局的QueryTable对象
		}
	//确定按键默认事件
	function onSave(){  
		var ids = qt.getBoxValue("checkboxs");
	//	if (!checkbox){						
	//		return;
	//		}	
		//	var id =ids.split(",");
		//	alert(ids);
		var i = 2;
				DWR.call('pointActivityService.modiftyPointRule1',i,ids,$("pointActivity_id").value,function(t){
					switchPage('detviewaa');
				showData();
				});
		//	for(var i=0;i<id.length;i++){
		//	}    
		
	}
	
	</script>
	</HEAD>
<BODY class="body" onload='load()'>
	<div id="listview">	
		<!--查询条件form-->
		<div class="form">
								<input   type="hidden"   name="pointActivity_id"   value="pointActivity_id">	
		</div>
		<!--查询结构列表-->
		<div id=datalist>
		</div>
	</div>
</BODY>
</HTML>
